home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / alph100p.zip / ALPHA.INT < prev    next >
Text File  |  1991-11-02  |  7KB  |  226 lines

  1. {$A+,B-,D-,E-,F+,G-,I-,L-,N-,O-,R-,S-,V-,X-}
  2.  
  3. Unit ALPHA;
  4.  
  5. (************************************************************************)
  6. (*                                                                      *)
  7. (*                  OFFERING TEXT DISPLAY FUNCTIONS FOR                 *)
  8. (*                       MULTI-TASKING ENVIRONMENTS                     *)
  9. (*                                                                      *)
  10. (*                              FEATURING                               *)
  11. (*                                                                      *)
  12. (*                         MULTIPLE VIDEO PAGES                         *)
  13. (*                     NO DIRECT VIDEO MEMORY UPDATES                   *)
  14. (*                         NO USE OF VIDEO PORTS                        *)
  15. (*                  USE OF STANDARD BIOS OUTPUT FUNCTIONS               *)
  16. (*                     USE OF STANDARD INPUT/OUTPUT                     *)
  17. (*                                                                      *)
  18. (************************************************************************)
  19.  
  20.  
  21. INTERFACE
  22.  
  23. Uses WOW;  { Requires version 1.01 of WOW }
  24.  
  25.  
  26. Type
  27.       Str4          = string[4];
  28.       Str7          = string[7];
  29.       Str16         = string[16];
  30.       Str80         = string[80];
  31.  
  32.       CursorShapes  = ( OFF, ON, BlOCK);
  33.  
  34.       EGARows       = ( at43, at50 );
  35.  
  36.       AlphaChoices  = ( No_AlphaExit,
  37.                         No_MainExit,
  38.                         Cga_Mode,
  39.                         Ega_Mode,
  40.                         Cga16_mode );
  41.  
  42.       VideoCards    = ( NOCARD, MDA, CGA, EGA, PGA, VGA, MCGA );
  43.  
  44.       Bkgrd         = ( Black8, Blue8,    Green8, Cyan8,
  45.                         Red8,   Magenta8, Brown8, White8);
  46.  
  47.  
  48. Const
  49.  
  50.       AlphaVer       = '1.00';
  51.  
  52.       DirectVideo   : boolean = FALSE;        { NOT USED BY ALPHA}
  53.  
  54.       CheckSnow     : boolean = FALSE;        { NOT USED BY ALPHA}
  55.  
  56. { Filler Characters }
  57.  
  58.       Space         = #032;     Star          = #042;
  59.       ShadeLight    = #176;     ShadeMedium   = #177;
  60.       ShadeHeavy    = #178;     Crosshatch    = #197;
  61.       CrossWeave    = #206;
  62.  
  63. { MONO ColorAttrS }
  64.  
  65.       Normal        = $07;      Underlined    = $01;
  66.       Reversed      = $70;      Invisible     = $00;
  67.  
  68. { TEXT modes }
  69.  
  70.       BW40          = 0;        { 40x25 B/W on Color Adapter }
  71.       CO40          = 1;        { 40x25 Color on Color Adapter }
  72.       BW80          = 2;        { 80x25 B/W on Color Adapter }
  73.       CO80          = 3;        { 80x25 Color on Color Adapter }
  74.       Mono          = 7;        { 80x25 on Monochrome ONLY Adapter }
  75.       Font8x8       = 256;      { EGA/VGA 8x8 FONT with 43/50 LINES}
  76.       EgaVga        = 256;      { EGA/VGA 8x8 FONT with 43/50 LINES}
  77.  
  78.  
  79. {        C O L O R   A T T R I B U T E   C O N S T A N T S          }
  80. {-------------------------------------------------------------------}
  81.                                 { ForeGround }
  82. { Low Intensity Background }    { EGA/VGA High Intensity Background }
  83.  
  84.       Black         = 00;       DarkGray      = 08;   Blink         = 128;
  85.       Blue          = 01;       LightBlue     = 09;
  86.       Green         = 02;       LightGreen    = 10;
  87.       Cyan          = 03;       LightCyan     = 11;
  88.       Red           = 04;       LightRed      = 12;
  89.       Magenta       = 05;       LightMagenta  = 13;
  90.       Brown         = 06;       Yellow        = 14;
  91.       LightGray     = 07;       White         = 15;
  92.  
  93. Var
  94.  
  95.       LastProc      : Pointer;  { Points to Optional Main Exit Procedure }
  96.  
  97.       LastMode      : integer;  { Provided for compatibility with CRT }
  98.  
  99.  
  100. {****************************************** CRT FUNCTIONS SUPPORTED }
  101.  
  102.       Procedure ClrEol              ;
  103.  
  104.       Procedure DelLine             ;
  105.  
  106.       Procedure HighVideo           ;
  107.  
  108.       Procedure InsLine             ;
  109.  
  110.       Procedure LowVideo            ;
  111.  
  112.       Procedure NormVideo           ;
  113.  
  114.       Procedure TextBackground      ( Color: byte);
  115.  
  116.       Procedure TextColor           ( Color: byte);
  117.  
  118.       Procedure TextMode            ( Mode: integer);
  119.  
  120.       Function  WhereX              : byte;
  121.  
  122.       Function  WhereY              : byte;
  123.  
  124.  
  125. {********************************************** NEW FUNCTIONS ADDED }
  126.  
  127. { VIDEO }
  128.  
  129.       Procedure AltPrintScr         ;
  130.  
  131.       Procedure ChangeColorXY       ( X,Y,Len,Foreground, Background: byte);
  132.  
  133.       procedure ChangeBackgroundXY  ( X,Y,Len,Color: byte);
  134.  
  135.       procedure ChangeForegroundXY  ( X,Y,Len,Color: byte);
  136.  
  137.       Procedure Change8ColorXY      ( X,Y,Len,Foreground: Byte;
  138.                                       Background: Bkgrd);
  139.  
  140.       procedure Change8BackgroundXY ( X,Y,Len: byte; Color: Bkgrd);
  141.  
  142.       Procedure Cursor              ( Shape: CursorShapes);
  143.  
  144.       Procedure Display             ( X,Y: byte; S: string);
  145.  
  146.       Procedure Echo                ( S: string);
  147.  
  148.       Procedure EchoLn              ( S: string);
  149.  
  150.       Procedure DisplayOver         ( X,Y: byte; S: string);
  151.  
  152.       Procedure EndofLine           ;
  153.  
  154.       Procedure FillPage            ( Ch: Char);
  155.  
  156.       Function  GetActivePage       : Pages;
  157.  
  158.       Function  GetBackGround       ( ColorAttr: byte)
  159.                                     : byte;
  160.  
  161.       Function  GetForeGround       ( ColorAttr: byte)
  162.                                     : byte;
  163.  
  164.       Procedure GetBoth             ( var ColorAttr: byte; CH: char);
  165.  
  166.       Function  GetColorAttr        : byte;
  167.  
  168.       Function  GetChar             : char;
  169.  
  170.       Procedure GotoX               ( X: byte);
  171.  
  172.       Procedure GotoY               ( Y: byte);
  173.  
  174.       Procedure Home                ;
  175.  
  176.       Procedure MakeAlphaChoice     ( Text: AlphaChoices);
  177.  
  178.       Function  MaxCols             : byte;
  179.  
  180.       Function  MaxRows             : byte;
  181.  
  182.       Procedure Prepare8Page        ( P: Pages;C: CursorShapes;
  183.                                       Foreground: byte; Background: Bkgrd);
  184.  
  185.       Procedure PreparePage         ( P: Pages;C: CursorShapes;
  186.                                       Foreground,Background: byte);
  187.  
  188.       Procedure ReverseColorXY      ( X,Y,Len: byte);
  189.  
  190.       Procedure SetColor            ( Foreground, Background: byte);
  191.  
  192.       Procedure Set8Color           ( Foreground: byte; Background: Bkgrd);
  193.  
  194.       Procedure SetActivePage       ( Num: Pages);
  195.  
  196.       Procedure SetBorder           ( Color: byte);
  197.  
  198.       Procedure SetPage             ( P: Pages);
  199.  
  200.       Procedure SetEGALines         ( Num: EGARows);
  201.  
  202.       Procedure TerminateOn         ( V: VideoCards);
  203.  
  204.       Function  VideoAdapter        : VideoCards;
  205.  
  206.       Procedure WhereXY             ( var X,Y: byte);
  207.  
  208.       Procedure WriteCharOver       ( Ch: char; Num: word);
  209.  
  210.  
  211. { Bonus String }
  212.  
  213.       Function  Color2Str           ( C: Byte): Str16;
  214.  
  215.       Function  Int2Str             ( Num: longint; Width: byte)
  216.                                     : str80;
  217.  
  218.       Function  Real2Str            ( Num: real; Width,Decimals: byte)
  219.                                     : str80;
  220.  
  221.       Function  Pages2Str           ( P: Pages)
  222.                                     : str7;
  223.  
  224.       Function  VideoAdapter2Str    ( V: Videocards)
  225.                                     : Str4;
  226.